//
//  GRMyOwnCommonViewController.m
//  YC_GRice
//
//  Created by Feng Liu on 2018/8/30.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRMyOwnCommonViewController.h"

@implementation GRMyOwnCommonViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = KGMBACKGROUND_COLOR;
    
    [self drawCanvas];
}

- (void)drawCanvas {
    CGFloat y             = IS_IPHONEX ? 88 : 64;
    self.commonHeader = [[UIView alloc] initWithFrame:CGRectMake(0, y, KscreenWidth, 55)];
    self.commonHeader.backgroundColor = [UIColor whiteColor];
    self.titleLabel        = [[UILabel alloc] initWithFrame:CGRectMake(16, 12.5, KscreenWidth-16, 30)];
    self.titleLabel.font  = [UIFont boldSystemFontOfSize:25];
    self.titleLabel.textColor = KGMBLACK_COLOR;
    [self.commonHeader addSubview:self.titleLabel];
    [self.view addSubview:self.commonHeader];
    
    self.tableView                 = [[UITableView alloc] initWithFrame:CGRectMake(0, y + 55, KscreenWidth, KscreenHeight-y-55) style:UITableViewStylePlain];
    self.tableView.delegate     = self;
    self.tableView.dataSource = self;
    self.tableView.tableFooterView = [UIView new];
    [self.view addSubview:self.tableView];
}

-(void)setCommontitle:(NSString *)commontitle {
    self.titleLabel.text = commontitle;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(GRBlankSpace *)blankSpace {
    if (!_blankSpace) {
        _blankSpace = [GRBlankSpace loadFromNib];
        _blankSpace.frame  = self.tableView.bounds;
        _blankSpace.hidden = YES;
        [self.tableView addSubview:_blankSpace];
    }
    return _blankSpace;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
